class Background extends PIXI.Container {
	constructor(uimanager) {
		super();

		const width = uimanager.realScreen.width;
		const height = uimanager.realScreen.height;

		// 绘制背景
		const frameMask = new PIXI.Graphics();
		frameMask.beginFill(0x50A0B0, 1);
		frameMask.drawRect(0, 0, width, height);
		frameMask.endFill();
		this.addChild(frameMask);
		// 绘制菱形112x56
		const bgWidth = 56;
		const bgHeight = 28;
		const wn = width / bgWidth;
		const hn = height / bgHeight;

		for(var x = 0; x < wn; x++) {
			for(var y = 0; y < hn; y++) {
				const frame = new PIXI.Graphics();
				frame.beginFill(0x307890, 1);
				//frame.lineStyle({ color: 0xffffff, width: 1, alignment: 0 });
				frame.moveTo(bgWidth/2,  0).lineTo(bgWidth, bgHeight/2).lineTo(bgWidth/2, bgHeight).
					lineTo(0, bgHeight/2).lineTo(bgWidth/2, 0);

				const frameX = x * bgWidth;
				const frameY = y * bgHeight;
				frame.position.set(frameX, frameY);
				this.addChild(frame);
			}
		}
	}
}